import React, { Component } from 'react';
import TreeTable from './components/TreeTable';
import axios from 'axios';
import cookie from 'react-cookies';
export default class Pagezhibiao extends Component {
  static displayName = 'Pagezhibiao';

  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {
    // const username = this.props.location.state.username;
    // console.log(username);
    // console.log('**',cookie.load('user'))
    // console.log('*^*',cookie.load('user') !== 'asd');
    // const test = this.props.location.state;
    // console.log(test);
    const baseurl = 'http://39.105.21.199:8989/IPEvaluation/evaluateManage/userShowEvaluateList.do?sessionId=';
    const sessionid = cookie.load('sessionId');
    axios.post(baseurl + sessionid).then((response) => {
      console.log(response.data.data);
      console.log(response.data.msg);
      const msg = response.data.msg;
      console.log('eqewq')
      if (msg === 'LoginInvalidate') {
        this.props.history.push('/pagelogin');
      }
    }).catch((error) => {
      console.log(error);
    });
  }

  render() {
    return (
      <div className="pagezhibiao-page">
        <TreeTable />
      </div>
    );
  }
}
